<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<#include "/jeebbs_sys/head.html"/>
<script type="text/javascript">
function getTableForm() {
	return document.getElementById('tableForm');
}
function optPriority() {
	var f = getTableForm();
	f.action="o_priority.do";
	f.submit();
}
function magiccheck(magicid){
	if($("#magicCheck"+magicid).attr("checked")){
		$("#magicAvail"+magicid).val(1);
	}else{
		$("#magicAvail"+magicid).val(0);
		}
}
</script>
</head>
<body>
<div class="body-box">
<div class="rhead">
	<div class="rpos"><@s.m "global.position"/>： <@s.m "magic.function"/> - <@s.m "global.list"/></div>
	<form class="ropt">
		<input type="submit" value="<@s.m "magic.give"/>" onclick="this.form.action='user_list.do';"/>
	</form>
	<form class="ropt">
		<input type="submit" value="<@s.m "config.configuration"/>" onclick="this.form.action='v_config.do';"/>
	</form>
	<div class="clear"></div>
</div>
<form id="tableForm" method="post">
<@p.table value=magics;magic,i,has_next><#rt/>
	<@p.column title="<input type='checkbox' onclick='Pn.checkbox(\"ids\",this.checked)'/>" width="20">
		<input type='checkbox' name='ids' value='${magic.id}'/><#t/>
	</@p.column><#t/>
	<@p.column code="magic.name">${magic.name!}</@p.column><#t/>
	<@p.column code="magic.price">${magic.price!}</@p.column><#t/>
	<@p.column code="magic.num">${magic.num!}</@p.column><#t/>
	<@p.column code="magic.weight">${magic.weight!}</@p.column><#t/>
	<@p.column code="magic.available">
		<input type="checkbox" name="magicCheck" onclick="magiccheck('${magic.id}')" <#if magic.available>checked="checked"</#if> id="magicCheck${magic.id!}"/>
		<input name="magicAvail" type="hidden" <#if magic.available>value="1"<#else>value="0"</#if> id="magicAvail${magic.id!}"/>
	</@p.column><#t/>
	<@p.column code="magic.order" align="center">
		<input type="text" name="prioritys" value="${magic.displayorder!}" style="width:40px"/>
		<input type="hidden" name="mids" value="${magic.id!}"/>
	</@p.column><#t/>
	<@p.column code="global.operate" align="center">
		<a href="v_edit.do?id=${magic.id}" class="pn-opt"><@s.m "global.edit"/></a> | <#rt/>
	</@p.column><#t/>
</@p.table>
<div>
&nbsp; <input type="button" value="<@s.m "global.saveOrder"/>" onclick="optPriority();"/>
</div>
</form>
<#include "/common/alert_message.html"/>
</div>
</body>
</html>